package net.it721.feignconsumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
public class ConsumerController {
    @Autowired
    private HelloServiceClient helloServiceClient;

    @GetMapping("/feign-consumer")
    public String helloConsumer(){
        Response<List<Book>> response = helloServiceClient.hello();
        log.info("{}", response);
        List<Book> bookList = response.getResult();
        log.info("{}", bookList);
        return "SUCCESS";
    }
}
